﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:MiniTwitter="clr-namespace:MiniTwitter"
    xmlns:MiniTwitter_Controls="clr-namespace:MiniTwitter.Controls"
    xmlns:MiniTwitter_Properties="clr-namespace:MiniTwitter.Properties"
    x:Class="MiniTwitter.Views.TimelineDialog" FontFamily="{Binding Path=FontName, Source={x:Static MiniTwitter_Properties:Settings.Default}, FallbackValue=Meiryo}"
    Title="MiniTwitter: タイムライン" Width="400" Height="360" ShowInTaskbar="False" Topmost="True" ResizeMode="NoResize"
    WindowStartupLocation="CenterOwner" Loaded="TimelineDialog_Loaded" TextOptions.TextFormattingMode="Display" UseLayoutRounding="True">
    <Window.BindingGroup>
        <BindingGroup NotifyOnValidationError="True">
            <BindingGroup.ValidationRules>
                <MiniTwitter_Controls:TimelineValidationRule ValidationStep="UpdatedValue"/>
            </BindingGroup.ValidationRules>
        </BindingGroup>
    </Window.BindingGroup>
    <Grid Margin="6">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" SharedSizeGroup="Text"/>
            <ColumnDefinition Width="20"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <TextBlock Grid.Column="0" Grid.Row="0" Text="タイムライン名" TextWrapping="Wrap" VerticalAlignment="Center"/>
        <TextBox Grid.Column="2" Grid.Row="0" Text="{Binding Path=Name}" Margin="0,3,0,3" />
        <RadioButton x:Name="listRadio" Grid.Column="0" Grid.Row="1" Content="リストを割り当てる" VerticalAlignment="Center" />
        <ComboBox Grid.Column="2" Grid.Row="1" x:Name="lists" Margin="0,3,0,3" DisplayMemberPath="Name" SelectedValuePath="Name" />
        <RadioButton x:Name="searchRadio" Grid.Column="0" Grid.Row="2" Content="検索タイムライン" VerticalAlignment="Center" />
        <TextBox Grid.Column="2" Grid.Row="2" x:Name="search" Margin="0,3,0,3" />
        <RadioButton x:Name="filterRadio" Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="3" Content="フィルタを指定する" Margin="0,4,0,4" />
        <ListView x:Name="FilterListView" Grid.ColumnSpan="3" Grid.Row="4" IsSynchronizedWithCurrentItem="True">
            <ListView.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="削除する(_D)" Click="DeleteFilterButton_Click" />
                </ContextMenu>
            </ListView.ContextMenu>
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="パターン" Width="200" DisplayMemberBinding="{Binding Path=Pattern}"/>
                    <GridViewColumn Header="フィルタタイプ" Width="150">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <ComboBox SelectedValue="{Binding Path=Type}" SelectedValuePath="Tag" HorizontalAlignment="Stretch">
                                    <ComboBoxItem Content="なし" Tag="{x:Static MiniTwitter:FilterType.None}"/>
                                    <ComboBoxItem Content="テキスト" Tag="{x:Static MiniTwitter:FilterType.Text}"/>
                                    <ComboBoxItem Content="テキスト + 正規表現" Tag="{x:Static MiniTwitter:FilterType.RegexText}"/>
                                    <ComboBoxItem Content="ユーザー名" Tag="{x:Static MiniTwitter:FilterType.Name}"/>
                                    <ComboBoxItem Content="ユーザー名 + 正規表現" Tag="{x:Static MiniTwitter:FilterType.RegexName}"/>
                                    <ComboBoxItem Content="ソース" Tag="{x:Static MiniTwitter:FilterType.Source}"/>
                                    <ComboBoxItem Content="ソース + 正規表現" Tag="{x:Static MiniTwitter:FilterType.RegexSource}"/>
                                </ComboBox>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
					</GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
        <StackPanel Grid.ColumnSpan="3" Grid.Row="5" Margin="0,4,0,0" Orientation="Horizontal">
        	<TextBox x:Name="FilterTextBox" Width="320" TextWrapping="Wrap"/>
        	<Button Content="追加" Click="AddFilterButton_Click" Width="50" Margin="4,0,0,0"/>
        </StackPanel>
        <StackPanel Grid.ColumnSpan="3" Grid.Row="6" Margin="0,6,0,0" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Content="OK" Width="80" IsDefault="True" Click="OkButton_Click" />
            <Button Content="キャンセル" Width="80" Margin="4,0,0,0" IsCancel="True" Click="CancelButton_Click" />
        </StackPanel>
    </Grid>
</Window>
